import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: "/HomeLayout",
    component: HomeView,
    children: [
      {
        path: "/HomeLayout",
        name: "HomeLayout",
        component: () => import("../views/HomeLayout")
      },
      {
        path: "/goods",
        name: "goods",
        component: () => import("../views/goods")
      },
      {
        path: "/about",
        name: "about",
        component: () => import("../views/about")
      },
      {
        path: "/confirmOrder",
        name: "confirmOrder",
        component: () => import("../views/confirmOrder")
      },
      {
        path: "/order",
        name: "order",
        component: () => import("../views/Order")
      },
      {
        path: "/shoppingCart",
        name: "shoppingCart",
        component: () => import("../views/shoppingCart")
      },
      {
        path: "/collect",
        name: "collect",
        component: () => import("../views/collect")
      },
      {
        path: "/details",
        name: "details",
        component: () => import("../views/details")
      },
    ]
  },



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
